xen/arm: gic_events_need_delivery and irq priorities
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 10 Jun 2014 14:07:20 +0000 (15:07 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 18 Jun 2014 10:32:10 +0000 (11:32 +0100)
commit72eaf29e8d70784aaf066ead79df1295a25ecfd0
treef1cfcc8bc6afe44032f67e878e876115fd8889bb
parentfa707af2d40f1b6fd24e3c19c47d6e70ee7b4678
xen/arm: gic_events_need_delivery and irq priorities

Introduce GIC_IRQ_GUEST_ACTIVE to track which irqs are currently
active in the guest.

gic_events_need_delivery should only return positive if an outstanding
pending irq has an higher group priority than the currently active group
priotity and the priority mask.
Read GICH_APR to find the active group priority.
Read GICH_VMCR to find the priority mask.
Find the highest priority non-active enabled irq by going through the
inflight list.

In gic_restore_pending_irqs replace lower priority pending (and not
active) irqs in GICH_LRs with higher priority irqs if no more GICH_LRs
are available.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/gic.c
xen/include/asm-arm/domain.h
xen/include/asm-arm/gic.h